package ReviewTest;

import java.util.Random;

public class demo04 {
    public static void main(String[] args) {
        String str = "abcdefac";
        System.out.println(found(str));
    }

    public static int found(String str) {
        Random r = new Random();
        int index = r.nextInt(0, str.length());
        char ss = str.charAt(index);
        System.out.println(ss);
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            if (ss == str.charAt(i)) {
                count++;
            }
        }
        return count;
    }
}
